package com.api.volunteer.controller;

import com.api.volunteer.annoation.NoAuth;
import com.api.volunteer.repository.VolunteerRecordRepository;
import com.api.volunteer.service.VolunteerRecordService;
import com.api.volunteer.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 邹宇杰
 * @email 2901570623@qq.com
 * @date 2022/4/1 12:23
 */
@RestController
public class SubscribeMessageController extends BaseController{

    @Autowired
    VolunteerRecordService volunteerRecordService;

    /**
     * 将活动消息推送给所有订阅了志愿活动的用户
     * @param volunteerId 志愿活动id
     * @return 接口响应
     */
    @PostMapping("/pushMessage")
    public Result pushMessage(@RequestParam("volunteerId") String volunteerId, @RequestParam("templateId") String templateId){

        return volunteerRecordService.sendMessage(volunteerId, templateId);

    }




}
